package service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import dao.RefereeDao;

import pojo.Group;
import pojo.GroupMember;
import pojo.Referee;
import pojo.User;
import service.RefereeService;

@Service("RefereeService")
public class RefereeServiceImpl implements RefereeService {

	@Autowired
	private RefereeDao refereeDao;

	public Referee login(String refereeName, String refereePassword) {
		Referee referee = new Referee();
		referee.setRefereeName(refereeName);
		referee.setRefereePassword(refereePassword);
		Integer countByParam = this.refereeDao.countByParam(referee);
		if (countByParam != null) {
			if (countByParam == 1) {
				Referee findByParam = this.refereeDao.findByParam(referee);
				return findByParam;
			}
		}
		return null;
	}

	public boolean initGroup(Group group, GroupMember groupMember,
			Integer gameId) {
		// TODO Auto-generated method stub
		return false;
	}

}
